/*
class Solution {
//奇偶树
    public boolean isEvenOddTree(TreeNode root) {
        Queue<TreeNode> q = new LinkedList<>();
        q.offer(root);
        int level = 0;

        while (!q.isEmpty()) {
            int size = q.size();
            int prevVal = (level % 2 == 0) ? Integer.MIN_VALUE : Integer.MAX_VALUE;

            for (int i = 0; i < size; i++) {
                TreeNode node = q.poll();
                int val = node.val;

                // 奇偶性判断
                if (level % 2 == 0) {
                    // 偶数层：必须是奇数、严格递增
                    if (val % 2 == 0 || val <= prevVal) return false;
                } else {
                    // 奇数层：必须是偶数、严格递减
                    if (val % 2 == 1 || val >= prevVal) return false;
                }

                prevVal = val;

                // 加入下一层节点
                if (node.left != null) q.offer(node.left);
                if (node.right != null) q.offer(node.right);
            }

            level++;
        }

        return true;
    }
}*/
